/*
 * @Author: 白袂 1741866590@qq.com
 * @Date: 2023-09-17 11:11:00
 * @LastEditors: 白袂 1741866590@qq.com
 * @LastEditTime: 2023-09-17 15:04:01
 * @FilePath: \obj_end_2023_9_17\mock\product.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
let Mock = require("mockjs")
let { Logistics } = require("./../until")
module.exports = {
    //商品管理页
    goodsManagment(req) {
        //接受用户的id  eg: req.userId 
        // console.log('req', req)
        let data = [];
        let deptNames = Mock.mock('@cword(3)');
        for(let i = 0; i < 7; i++) {
            let pu = {
                deptName: Mock.mock('@cword(3)'),
                deptNo: Mock.mock('@natural(2001, 2999)'),
                editTime: Mock.mock('@datetime()'),
                editUser: Mock.mock('@cname')
            }
            data.push(pu);
        }
        return {
            code: 200,
            message: "成功",
            data: data 
        }
    },
    //物流管理
    goodsLogistics(req) {
        let data = [];
        let logisticsCompany = Logistics();
        for(let i = 0; i < 10; i++) {
            let pu = {
                logisticsNo: Mock.mock('@natural(100101, 100999)'),
                logisticsNum: Mock.mock('@natural(200101, 200999)'),
                logisticsUserName: Mock.mock('@cname'),
                logisticsStart: Mock.mock('@city(true)'),
                logisticsEnd: Mock.mock('@city(true)'),
                logisticsSendDate: Mock.mock('@datetime'),
                logisticsActive: Mock.mock('@datetime()'),
                logisticsCompany: logisticsCompany[i],
                logisticsMoney: Mock.mock('@cname'),
                logisticsRemark: Mock.mock('@csentence(3,5)')
            }
            data.push(pu);
        }
        return {
            code: 200,
            message: "成功",
            data: data 
        }
    }
}